POV-Ray : Newsgroups : povray.general : Problem with pigment_map : Problem with pigment_map Server Time
31 Jul 2024 08:19:30 EDT (-0400)
  Problem with pigment_map  
From: Yadgar
Date: 22 Jul 2007 04:45:02
Message: <web.46a318d48aa1d48566bd28430@news.povray.org>
High!

I'm currently trying to build a gradient y texture to generate a 16 bit
heightfield from an isosurface terrain. Here's the code:

#declare HF16 =
texture
{
  pigment
  {
    gradient y
    pigment_map
    {
      #declare a=0;
      #while (a<127)
        [a/256
          pigment  // here the error occurs
          {
            gradient y
            color_map
            {
              [0 rgb <a/255, 0, 0>]
              [1 rgb <a/255, 1, 0>]
            }
            scale 1/256
          }
        ]
        [(a+1)/256
          pigment
          {
            gradient y
            color_map
            {
              [0 rgb <a/255, 0, 0>]
              [1 rgb <a/255, 1, 0>]
            }
            scale 1/256
          }
        ]
        #declare a=a+1;
      #end
    }
  }
  finish { ambient 1 diffuse 0 }
}

Everytime I try to start my small test scene, I get the error message "Parse
Error: expected "[", pigment found instead". Why?

See you on www.khyberspace.de !

Yadgar


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.